package edu.zut.main.thread;

public class ThreadPriority {
    public static void main(String[] args) {

        Thread thread = new Thread(() -> System.out.println("thread-A running"));

        Thread thread2 = new Thread(() -> System.out.println("thread-B running"));
        //线程的优先级  1-10   默认5  优先级越高，优先获取cpu资源
        thread.setPriority(9);

        thread2.setPriority(4);

        thread.start();
        thread2.start();
    }


}
